package summer_vacation.yangyiqing.m201508;
import java.util.Scanner;

/**
 * Created by Administrator on 2015/8/30 0030.
 */
public class Java_32 {
    public static void main(String[] args){
        Scanner s=new Scanner(System.in);
        System.out.println("请输入一个四位正整数：");
        int n=s.nextInt();
        int a,b,c,d;
        a=n%10;
        b=(n-a)%100/10;
        c=(n-a-b*10)%1000/100;
        d=(n-a-b*10-c*100)/1000;
        int m=0;
        m=a*a+b*b+c*c+d*d;
        System.out.println("您输入的数字是："+n+"您要的结果是："+m);
    }
}
